import VueRouter from 'vue-router'

// 导入对应的路由组件
import HomeContainer from './components/navbar/HomeContainer.vue'
import MovieContainer from './components/navbar/MovieContainer.vue'
import TvContainer from './components/navbar/TvContainer.vue'
import VarietyContainer from './components/navbar/VarietyContainer.vue'
import RankContainer from './components/navbar/RankContainer.vue'
import TvList from './components/tv/TvList.vue'
import TVInfo from './components/tv/TVInfo.vue'
import MovieList from './components/movie/MovieList.vue'
import MovieInfo from './components/movie/MovieInfo.vue'
import VarietyList from './components/variety/VarietyList.vue'
import VarietyInfo from './components/variety/VarietyInfo.vue'
import Login from './components/login/Login.vue'
import Register from './components/login/register.vue'

// 3.创建路由对象
var router = new VueRouter({
    routes:[ // 配置路由规则
        { path:'/', redirect:"/home" },
        { path:'/home', component:HomeContainer },
        { path:'/movie', component:MovieContainer },
        { path:'/tv', component:TvContainer },
        { path:'/variety', component:VarietyContainer },
        { path:'/rank', component:RankContainer },
        { path:'/tvList/:id', component:TvList },
        { path:'/tvInfo/:id', component:TVInfo },
        { path:'/movieList/:id', component:MovieList },
        { path:'/movieInfo/:id', component:MovieInfo },
        { path:'/varietyList/:id', component:VarietyList },
        { path:'/varietyInfo/:id', component:VarietyInfo },
        { path:'/login', component:Login },
        { path:'/register', component:Register },
    ],
    linkActiveClass:'choose-active'  // 覆盖默认的路由高亮的类，默认的类叫做 router-link-active
})

// 把路由对象暴露出去
export default router